#include <stdio.h>

int main() {
    int a, b;
    scanf("%d %d", &a, &b);

    int c = a / 100;
    int d = a % 100;

    int e = c * 60 + d + b;

    int f = e / 60;
    int g = e % 60;

    if (g < 10)
        printf("%d0%d\n", f, g);
    else
        printf("%d%d\n", f, g);

    return 0;
}
